<?php
//根目录定义
define("ROOTDIR",$_SERVER['DOCUMENT_ROOT']."/");
session_start();
//加载基类与函数库
include ROOTDIR."include/lxbase.class.php";
include ROOTDIR."include/wx.class.php";
include ROOTDIR."public/func.php";
//控制器目录
define("CPATH",ROOTDIR."minisite/hotel/c/");
define("CPOSTFIX",".class");

//获得URL
$app_path= str_replace($_SERVER['DOCUMENT_ROOT'], '', __FILE__);    
$app_request=trim(str_replace($app_path, '', $_SERVER['REQUEST_URI']),"/");
//解析URL
$urlinfo = Lxbase::urlreload($app_request);
$model = empty($urlinfo["model"])?"Index_con":ucfirst(strtolower($urlinfo["model"]))."_con";
$func = empty($urlinfo["function"])?"index":$urlinfo["function"];
$murl=empty($urlinfo["model"])?"index":strtolower($urlinfo["model"]);
include(CPATH.$murl.CPOSTFIX.".php");
if(!class_exists($model)) die('没有找到类'.$model);
$obj = new $model();
if(method_exists($obj,'setinit')){
	$obj->setinit("minisite/hotel/");
}
if(!empty($_COOKIE['UID']) && method_exists($obj,'getUserinfo') && empty($_SESSION['uinfo'])){
	$obj->getUserinfo($_COOKIE['UID']);
}
$obj->$func();
